﻿using System;
using System.Security;

namespace MyWcfLib
{
	public static class Extensions
	{
		public static string ToXmlString(this string s)
		{
			return SecurityElement.Escape(s);
		}

		public static bool IsNumeric(this string s)
		{
			double t = 0.0;
			if (double.TryParse(s, out t))
				return true;
			else
				return false;
		}

		public static bool IsInteger(this string s)
		{
			long t = 0;
			if (long.TryParse(s, out t))
				return true;
			else
				return false;
		}
	}
}
